﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
html {
	height: 100%
}

body {
	height: 100%;
	margin: 0px;
	padding: 0px
}

#container {
	height: 100%
}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.3"></script>
</head>
<body>
	<div id="container"></div>
	<script type="text/javascript">
	var sContent ="<h1>" + "结婚啦！"+ "</h1>";
		var map = new BMap.Map("container"); // 创建地图实例
		var lat = 30.1536;
		var lng = 120.1124;
		var point = new BMap.Point(lng, lat); // 创建点坐标
		map.centerAndZoom(point, 14); // 初始化地图，设置中心点坐标和地图级别
		map.addControl(new BMap.NavigationControl());
		map.addControl(new BMap.ScaleControl());
		map.addControl(new BMap.OverviewMapControl());
		map.addControl(new BMap.MapTypeControl());
		map.enableScrollWheelZoom();
		var marker = new BMap.Marker(point); // 创建标注  
		map.addOverlay(marker);
		var opts = {
			width : 250, // 信息窗口宽度  
			height : 100, // 信息窗口高度  
			title : "Hello" // 信息窗口标题  
		};
		var infoWindow = new BMap.InfoWindow(sContent); // 创建信息窗口对象  
		marker.addEventListener("click", function() {
			this.openInfoWindow(infoWindow);
			//图片加载完毕重绘infowindow
			document.getElementById('imgDemo').onload = function() {
				infoWindow.redraw();
			};
		});
	</script>
</body>
</html>